import Vue from "vue";
import Router from "vue-router";
import Login from "./components/Login.vue";
import Home from "@/components/Home.vue";
import { rightsmanagement } from "@/api/routerpath";
import mainHome from "@/views/main/mainHome.vue";
Vue.use(Router);

export default new Router({
  mode: "history",
  base: process.env.BASE_URL,
  routes: [
    {
      path: "/",
      name: "Login",
      component: Login
    },
    {
      path: "/home",
      name: "Home",
      component: Home,
      children: [
        {
          path: "",
          name: "mainHome",
          component: mainHome
        },
        ...rightsmanagement
      ]
    }
  ]
});
